#include <REGX52.H>
#include <INTRINS.H>

//自定义延时函数
void Delay(unsigned int xms)		//@11.0592MHz
{
	unsigned char i, j;

	while(xms--){
		_nop_();
		i = 2;
		j = 199;
		do
		{
			while (--j);
		} while (--i);
	}
}


void main(){
	//自定义延时时间
	unsigned int delayTime = 200;
	
	P2 = 0xFE;		//1111 1110
	Delay(delayTime);	//延时
	P2 = 0xFD;		//1111 1101
	Delay(delayTime);	//延时
	P2 = 0xFB;		//1111 1011
	Delay(delayTime);	//延时
	P2 = 0xF7;		//1111 0111
	Delay(delayTime);	//延时
	P2 = 0xEF;		//1110 1111
	Delay(delayTime);	//延时
	P2 = 0xDF;		//1101 1111
	Delay(delayTime);	//延时
	P2 = 0xBF;		//1011 1111
	Delay(delayTime);	//延时
	P2 = 0x7F;		//0111 1111
	Delay(delayTime);	//延时
}